<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <link href="/dtpr/bootstrap/css/bootstrap.min.css" rel="stylesheet" type="text/css">
    <link href="/dtpr/Flat-UI/css/flat-ui.min.css" rel="stylesheet" type="text/css">
    <link href="/dtpr/bootstrap-select/css/bootstrap-select.min.css" rel="stylesheet" type="text/css">
    <link href="/dtpr/css/home.css" rel="stylesheet" type="text/css">
    <link href="/dtpr/css/exam.css" rel="stylesheet" type="text/css">
    <script src="/dtpr/bootstrap/js/jquery-3.2.1.min.js"></script>
    <script src="/dtpr/ckeditor/ckeditor.js"></script>
    <script src="/dtpr/js/home.js"></script>
    <script src="/dtpr/html/background/exam/js/online.js"></script>
    <title>在线出题</title>
</head>
<body>
<!--网页头-->
<script src="/dtpr/js/bgHead.js"></script>
<!--网页体-->
<div class="main">
    <div class="p-body">
        <form class="form-horizontal" action="index.php?exam-master-questions-addquestion" method="post">
            <!--左侧选择栏-->
            <div class="col-sm-3">
                <div class="set-control border-circle text-center">
                    <h4 class="text-center">请选择出题范围</h4>
                    <!--选择信息-->
                    <div>
                        <div class="set-select text-center">
                            <div class="btn-group">
                                <button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
                                    <!--按钮的初始值-->
                                    <script>
                                        var id=getQueryString("id");
                                        if(id==1){
                                            document.write("选择题");
                                        }else if(id==2){
                                            document.write("判断题");
                                        }else if(id==3){
                                            document.write("填空题");
                                        }else {
                                            document.write("选择题");
                                        }
                                    </script>
                                        <span class="caret"></span>
                                </button>
                                <ul class="dropdown-menu">
                                    <li><a href="index.php?exam-master-questions-questioncontrol&id=1">选择题</a></li>
                                    <li><a href="index.php?exam-master-questions-questioncontrol&id=2">判断题</a></li>
                                    <li><a href="index.php?exam-master-questions-questioncontrol&id=3">填空题</a></li>
                                    <li><a href="index.php?exam-master-questions-questioncontrol&id=4">阅读题</a></li>
                                </ul>
                            </div>
                        </div>
                        <div class="set-select text-center">
                            <select class="form-control" id="subject">
                                <option selected value="0">请选择科目</option>
                            </select>
                        </div>
                        <div class="set-select text-center">
                            <select class="form-control" id="volume">
                                <option selected value="0">请选择册次</option>
                            </select>
                        </div>
                        <div class="set-select text-center">
                            <select class="form-control" id="section">
                                <option selected value="0">请选择章节</option>
                            </select>
                        </div>
                        <div class="set-select text-center">
                            <h4 class="text-center">请选择难度</h4>
                            <input type="radio" name="args[questionlevel]" value="1">易　
                            <input type="radio" name="args[questionlevel]" value="2">中　
                            <input type="radio" name="args[questionlevel]" value="3">难　
                        </div>
                        <!--隐藏的选择项-->
                        <div class="hidden">
                            <!--选择章节-->
                            <input type="hidden" value="0" name="id" id="section-id">
                            <input type="hidden" name="name" id="section-name">
                            <!--选择题目类型-->
                            <input type="hidden" name="args[questiontype]">
                        </div>
                    </div>
                </div>
            </div>
            <!--右侧内容栏-->
            <div class="col-xs-9">
                <!--题目内容-->
                <div class="form-group">
                    <label class="col-sm-2 control-label">
                        <h3>题目内容</h3>
                    </label>
                    <div class="col-sm-10">
                        <textarea name="args[question]" rows="10" id="container" cols="80">
                        </textarea>
                        <script>
                            CKEDITOR.replace('container');
                        </script>
                    </div>
                </div>
                <!--答案-->
                <div class="answer-block">
                </div>
                <!--详解-->
                <div class='form-group'>
                    <label class='col-sm-2 control-label'><h3>详解</h3></label>
                    <div class='col-sm-10'>
                            <textarea name='args[questiondescribe]' rows='4' id='answer' cols='80'>
                            </textarea>
                        <script>
                            CKEDITOR.replace('answer');
                        </script>
                    </div>
                </div>
                <!--提交按钮-->
                <div class="row text-center">
                    <button type="submit" class="btn btn-primary">提交</button>
                </div>
            </div>
        </form>
        <div class="clearfix"></div>
    </div>
</div>

<!--网页脚-->
<script src="/dtpr/js/foot.js"></script>
<script src="/dtpr/js/select.js"></script>
<script src="/dtpr/Flat-UI/js/flat-ui.min.js"></script>
<script src="/dtpr/bootstrap-select/js/bootstrap-select.min.js"></script>
<script src="/dtpr/html/background/exam/js/validation.js"></script>
<script>
    //初始化答案内容区
    var id=getQueryString("id");
    var parent=$(".answer-block");
    if(id==1){
        multiple(parent);
    }else if(id==2){
        tfng(parent);
    }else if(id==3){
        completion(parent);
    }else {
        multiple(parent);
    }

    //表单拦截，确定提交的数据没毛病
    $(".form-horizontal").submit(function () {
        return validationOnline();
    });
</script>
</body>
</html>